package controller.room
{
	import events.room.EventRemoveRoomItems;
	
	import model.ModelProject;
	
	import org.flashIso.engine.core.IsoObjectBase;
	import org.robotlegs.mvcs.Command;
	
	public class CommandRemoveRoomItems extends Command
	{
		[Inject]
		public var event:EventRemoveRoomItems;
		
		[Inject]
		public var mp:ModelProject;
		
		override public function execute() : void {
			mp.projectModified = true;

			var i:uint;
			for (i = 0; i < event.itemsToRemove.length; i++){
				event.room.map.removeElement(event.itemsToRemove[i] as IsoObjectBase);
			}
		}
	}
}